package com.sskj.zixun.presenter;

import com.lzy.okgo.model.Response;
import com.sskj.zixun.bean.PlatFormInfoBean;
import com.sskj.zixun.http.HttpConfig;
import com.sskj.zixun.ui.activity.ZixunDetailActivity;
import com.sskj.common.base.HttpData;
import com.sskj.lib.http.JsonCallBack;


public class ZixunDetailActivityPresenter extends BasePresenter<ZixunDetailActivity> {
    /**
     * 获取新闻资讯头部Banner
     */
    public void getZixunDetail(int id) {
        httpService.getZixunDetail(id).execute(new JsonCallBack<HttpData<PlatFormInfoBean.InfoBean>>(this) {
            @Override
            public void onSuccess(Response<HttpData<PlatFormInfoBean.InfoBean>> response) {
                HttpData<PlatFormInfoBean.InfoBean> httpData = response.body();
                if (httpData.getStatus() == HttpConfig.OK) {
                    if (httpData.getData() != null) {
                        mView.setDetailText(response.body().getData());
                    }
                }
            }
        });
    }
}
